<div class="meeting-my">

    <!-- 搜索 -->
    <div class="meeting-header">
        <button type="button" class="btn btn-default" id="check">
            <i class="fa fa-th-list "></i>
            筛选
            <if condition="$_GET['title'] || $_GET['start'] || $_GET['end'] || $_GET['create']|| $_GET['status']">
                <i class="fa fa-caret-up " id="ic"></i>
                <else/>
                <i class="fa fa-caret-down" id="ic"></i>
            </if>
        </button>

        <if condition="$_GET['title'] || $_GET['start'] || $_GET['end'] || $_GET['create']|| $_GET['status']">
            <div id="file-filter"style="display: block;">
            <else/>
            <div id="file-filter" style="display: none;">
        </if>
            <form action="" class="layui-form" autocomplete="off" method="get">
                <input type="hidden" name="tab" value="{$_GET['tab']}">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">会议名称</label>
                        <div class="layui-input-inline">
                            <input type="text" name="title" value="{$Think.get.title}" class="layui-input" placeholder="会议名称">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">会议时间</label>
                        <div class="layui-input-inline">
                            <input type="text" name="start" value="{$Think.get.start}" class="layui-input start" readonly placeholder="起始于">
                        </div>
                        <div class="layui-form-mid">-</div>
                        <div class="layui-input-inline">
                            <input type="text" name="end" value="{$Think.get.end}" class="layui-input end" readonly placeholder="终止于">
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">申请人</label>
                        <div class="layui-input-inline">
                            <select name="create" lay-search>
                                <option value=""></option>
                                <volist name="users" id="user">
                                    <option value="{$user.id}" <eq name="Think.get.create" value="$user.id">selected</eq>>{$user.nickname}</option>
                                </volist>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">会议状态</label>
                        <div class="layui-input-inline">
                            <select name="status">
                                <option value=""></option>
                                <option value="1" <eq name="Think.get.status" value="1">selected</eq>>未开始</option>
                                <option value="2" <eq name="Think.get.status" value="2">selected</eq>>进行中</option>
                                <option value="3" <eq name="Think.get.status" value="3">selected</eq>>已结束</option>
                                <option value="-1" <eq name="Think.get.status" value="-1">selected</eq>>已取消</option>
                            </select>
                        </div>
                        <div class="layui-input-inline ml-15">
                            <button type="submit" class="layui-btn" >提交</button>
                            <a href="/meetings?tab={$_GET['tab']}" class="layui-btn layui-btn-danger">重置条件</a>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>

    <!-- 列表 -->
    <div class="meeting-my-main">

        <!-- 切换列表 -->
        <div class="meeting-my-list">
            <ul class="list clearfix">
                <li class="<eq name='Think.get.tab' value='list'>active</eq>">
                    <a href="/meetings?tab=list" data-action="list">
                        <span>所有会议</span>
                        <span class="ml-5">{$allCount}</span>
                    </a>
                </li>
                <li class="<eq name='Think.get.tab' value='participate'>active</eq>">
                    <a href="/meetings?tab=participate" data-action="join">
                        <span>我参加的会议</span>
                        <span class="ml-5">{$participateCount}</span>
                    </a>
                </li>
                <li class="<eq name='Think.get.tab' value='apply'>active</eq>">
                    <a href="/meetings?tab=apply" data-action="apply">
                        <span>我申请的会议</span>
                        <span class="ml-5">{$applyCount}</span>
                    </a>
                </li>
            </ul>
        </div>

        <!-- 展示列表 -->
        <div class="meeting-my-content">
            <notempty name="list">
                <ul class="content clearfix">
                    <volist name="list" id="vo">
                        <li data-id="{$vo.id}">
                            <div class="meeting-my-detail">
<!--                                <p class="text-muted">{$vo.year}</p>-->
                                <p class="text">{$vo.year}</p>
                                <p>
                                    <span class="time">{$vo.start}</span>
                                    <span >至</span>
                                    <span class="time">{$vo.end}</span>
                                </p>
                                <div class="hr"></div>
                                <p class="name" title="{$vo.title}">{$vo.title}</p>
                                <div>
                                    <img src="{$vo.user.author_avatar}" width="50" height="50" class="img-circle" alt="用户头像">
                                    <br>
<!--                                    <small class="text-muted">{$vo.user.author_name}</small>-->
                                    <small>{$vo.user.author_name}</small>
                                </div>
                                <div class="room-name" title="
                                            <volist name='vo.rooms' id='room'>
                                                {$room.name}&nbsp;&nbsp;
                                            </volist>
                                            ">
                                    <volist name="vo.rooms" id="room">
                                        {$room.name}&nbsp;&nbsp;
                                    </volist>
                                </div>
                            </div>
                            <div class="meeting-status">
                                <eq name="vo.status" value="0">
                                    <eq name="vo.time_status" value="0">
                                        <img src="/Public/home/img/not_start.png" alt="会议未开始">
                                    </eq>
                                    <eq name="vo.time_status" value="1">
                                        <img src="/Public/home/img/processing.png" alt="会议进行中">
                                    </eq>
                                    <eq name="vo.time_status" value="2">
                                        <img src="/Public/home/img/over.png" alt="会议已结束">
                                    </eq>
                                    <else/>
                                    <img src="/Public/home/img/cancel.png" alt="会议已取消">
                                </eq>
                            </div>
                        </li>
                    </volist>
                </ul>
                <!--分页-->
                <ul class="pagination pagination-edit ml-20">{$Page}</ul>
                <else/>
                <div class="no&#45;&#45;info"></div>
            </notempty>
        </div>
    </div>
</div>

<script>
    $(function(){
        layui.use(['form','element'],function(){
            var form = layui.form;

            //点击每个会议进入详情页
            $(document).on('click', '.meeting-my-content .content li', function () {
                var dataId = $(this).attr('data-id');
                location.href = '/meetings/show?id=' + dataId;
            });

            //日期
            $('.layui-form .layui-input.start').datetimepicker({
                language: 'zh-CN',
                minView: 'month',
                format: "yyyy-mm-dd",
                todayHighlight: true,
                autoclose: true,
                todayBtn: true
            });
            $('.layui-form .layui-input.end').datetimepicker({
                language: 'zh-CN',
                minView: 'month',
                format: "yyyy-mm-dd",
                todayHighlight: true,
                autoclose: true,
                todayBtn: true
            });

            //隐藏和显示及切换图标
            $('#check').click(function () {
                $('#file-filter').slideToggle();
                $('#ic').toggleClass("fa-caret-up fa-caret-down");
            });
        })
    })
</script>